package com.dpwx.module.startup.view;

import org.puremvc.java.multicore.interfaces.INotification;

import com.dpwx.framework.mvc.BaseActivity;
import com.dpwx.framework.mvc.BaseMediator;
import com.dpwx.framework.mvc.BaseView;
import com.dpwx.module.startup.StartupFacade;

public class LoginMediator extends BaseMediator {

	public LoginMediator(BaseActivity activity, String name) {
		super(activity, name);
	}

	@Override
	public BaseView onCreateView() {
		return new LoginView(getActivity());
	}

	@Override
	public String[] listNotificationInterests() {
		return new String[]{StartupFacade.CMD_SHOW_LOGIN};
	}
	
	@Override
	public void handleNotification(INotification notification) {
		if (StartupFacade.CMD_SHOW_LOGIN.equals(notification.getName())) {
			getViewComponent().show();
		}
	}

}
